import { requestClient } from '#/api/request';

export namespace DeptTree {
  export interface FluffyChild {
    id: number;
    label: string;
  }
  export interface PurpleChild {
    id: number;
    label: string;
    children?: FluffyChild[];
  }
  export interface DatumChild {
    id: number;
    label: string;
    children?: PurpleChild[];
  }
  export interface Datum {
    id: number;
    label: string;
    children: DatumChild[];
  }
  export interface GetListReturn {
    msg: string;
    code: number;
    data: Datum[];
  }
}

// 获取树结构
export const getDeptTreeList = () =>
  requestClient.get<DeptTree.GetListReturn>('/system/dept/treeselect', {});
